package com.ccctop.crowd.contract;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.Bool;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.Utf8String;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.abi.datatypes.generated.Uint8;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.RemoteFunctionCall;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tuples.generated.Tuple6;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;

/**
 * <p>Auto generated code.
 * <p><strong>Do not modify!</strong>
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the
 * <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 4.8.7.
 */
@SuppressWarnings("rawtypes")
public class CrowdFunding extends Contract {
    public static final String BINARY = "608060405234801561001057600080fd5b5060008054610100600160a81b03191633610100021760ff19168155610fbb90819061003c90396000f3fe6080604052600436106100fe5760003560e01c806390fe6ddb11610095578063d7bb99ba11610064578063d7bb99ba146103c5578063d845a4b3146103cd578063ea8a1af0146103f7578063ec2336841461040c578063f851a440146104c8576100fe565b806390fe6ddb14610353578063a6f9dae114610368578063aeed860e1461039b578063d1e15045146103b0576100fe565b806333364197116100d157806333364197146102245780633ccfd60b146102505780634e69d560146102655780636eaadcde1461029e576100fe565b8063085634ec146101005780631162f6721461011557806317c7a0e21461013c57806317fba2121461016f575b005b34801561010c57600080fd5b506100fe6104f9565b34801561012157600080fd5b5061012a610528565b60408051918252519081900360200190f35b34801561014857600080fd5b5061012a6004803603602081101561015f57600080fd5b50356001600160a01b031661052d565b34801561017b57600080fd5b5061012a6004803603604081101561019257600080fd5b8101906020810181356401000000008111156101ad57600080fd5b8201836020820111156101bf57600080fd5b803590602001918460018302840111640100000000831117156101e157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061054c915050565b34801561023057600080fd5b5061012a6004803603602081101561024757600080fd5b503515156105d8565b34801561025c57600080fd5b5061012a6106b5565b34801561027157600080fd5b5061027a61074e565b6040518082600581111561028a57fe5b60ff16815260200191505060405180910390f35b3480156102aa57600080fd5b5061012a600480360360408110156102c157600080fd5b8101906020810181356401000000008111156102dc57600080fd5b8201836020820111156102ee57600080fd5b8035906020019184600183028401116401000000008311171561031057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610757915050565b34801561035f57600080fd5b5061012a6107f5565b34801561037457600080fd5b506100fe6004803603602081101561038b57600080fd5b50356001600160a01b03166107fc565b3480156103a757600080fd5b5061012a610988565b3480156103bc57600080fd5b506100fe61098e565b61012a610ab6565b3480156103d957600080fd5b5061012a600480360360208110156103f057600080fd5b5035610bf0565b34801561040357600080fd5b5061012a610c8a565b34801561041857600080fd5b50610421610d8d565b604080516001600160a01b0388168152908101859052606081018490526080810183905281151560a082015260c06020808301828152885192840192909252875160e084019189019080838360005b83811015610488578181015183820152602001610470565b50505050905090810190601f1680156104b55780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b3480156104d457600080fd5b506104dd610e7b565b604080516001600160a01b039092168252519081900360200190f35b3373cf85e5ad29927ff63f0a17ae6fd5352c512f56621461051957600080fd5b6000805460ff19166001179055565b475b90565b6001600160a01b0381166000908152600a60205260409020545b919050565b6000805461010090046001600160a01b0316331461056c575060016105d2565b6000805460ff16600581111561057e57fe5b14156105ce578251610597906001906020860190610eee565b5060028290556000600381905560048190556005805460ff199081169091558154600192911682805b0217905550600090506105d2565b5060025b92915050565b3360009081526008602052604081205460ff166105f757506001610547565b600360005460ff16600581111561060a57fe5b14156106ad576001821515141561064657336000908152600b60205260409020805460ff19166001908117909155600c80549091019055610677565b336000908152600b60205260409020805460ff19169055600c5415610670576001600c5403610673565b60005b600c555b600754600c5460020210610697576000805460ff191660051790556106a5565b6000805460ff191660041790555b506000610547565b506002919050565b6000805461010090046001600160a01b031633146106d55750600161052a565b600560005460ff1660058111156106e857fe5b141561074857600080546006546040516101009092046001600160a01b0316926108fc8215029290818181858888f1935050505015801561072d573d6000803e3d6000fd5b5050600680546004805491909103905560009081905561052a565b50600290565b60005460ff1690565b6000805461010090046001600160a01b0316331415610778575060016105d2565b600160005460ff16600581111561078b57fe5b14156105ce5782516107a4906001906020860190610eee565b5060028290556003548211156107bb5760006107be565b60015b6005805460ff1916911515919091179081905560ff16156107ed57600080546002919060ff19166001836105c0565b5060006105d2565b6298968081565b3373cf85e5ad29927ff63f0a17ae6fd5352c512f56621461081c57600080fd5b60008054610100600160a81b0319166101006001600160a01b038416021760ff1916815560408051602081019182905282905261085c9160019190610eee565b506000600281905560038190556005805460ff191690556007819055600c81905560405173cf85e5ad29927ff63f0a17ae6fd5352c512f5662914780156108fc02929091818181858888f193505050501580156108bd573d6000803e3d6000fd5b5060095460005b818110156109445760006001600160a01b0316600982815481106108e457fe5b6000918252602090912001546001600160a01b03161461093c57600b60006009838154811061090f57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020805460ff191690555b6001016108c4565b50805b801561098357600980548061095857fe5b600082815260209020810160001990810180546001600160a01b031916905590810190915501610947565b505050565b60075490565b3373cf85e5ad29927ff63f0a17ae6fd5352c512f56621480156109c15750600460005460ff1660058111156109bf57fe5b145b6109ca57600080fd5b60005b600954811015610ab3576000600982815481106109e657fe5b6000918252602090912001546001600160a01b031690508015610aaa576001600160a01b0381166000818152600a602052604080822054905181156108fc0292818181858888f19350505050158015610a43573d6000803e3d6000fd5b506001600160a01b0381166000908152600860205260409020805460ff191690556009610a6f82610e93565b81548110610a7957fe5b6000918252602080832090910180546001600160a01b03191690556001600160a01b0383168252600a905260408120555b506001016109cd565b50565b6000805461010090046001600160a01b0316331415610ad75750600161052a565b600160005460ff166005811115610aea57fe5b14610af75750600261052a565b60405130903480156108fc02916000818181858888f19350505050158015610b23573d6000803e3d6000fd5b50600380543490810182556004805482019055336000818152600860209081526040808320805460ff19166001908117909155600980548083019091557f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b031916909517909455600a9091529020805490920190915560078054909101905560025490541015610bbe576000610bc1565b60015b6005805460ff1916911515919091179081905560ff1615610bea576000805460ff191660021790555b50600090565b6000805461010090046001600160a01b03163314610c1057506001610547565b600260005460ff166005811115610c2357fe5b1480610c3f5750600560005460ff166005811115610c3d57fe5b145b156106ad57600454821115610c5657506003610547565b600260005460ff166005811115610c6957fe5b1415610c7d576000805460ff191660031790555b5060068190556000610547565b3360009081526008602052604081205460ff16610ca95750600161052a565b600160005460ff166005811115610cbc57fe5b141561074857336000818152600a60205260408082205490516298967f1990910180156108fc0292909190818181858888f19350505050158015610d04573d6000803e3d6000fd5b50336000818152600a60209081526040808320805460038054919091039055546004805491909103905560089091529020805460ff19169055600990610d4990610e93565b81548110610d5357fe5b6000918252602080832090910180546001600160a01b0319169055338252600a90526040812081905560078054600019019055905061052a565b60006060600080600080600060019054906101000a90046001600160a01b03166001600254600354600454600560009054906101000a900460ff16859550848054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e605780601f10610e3557610100808354040283529160200191610e60565b820191906000526020600020905b815481529060010190602001808311610e4357829003601f168201915b50505050509450955095509550955095509550909192939495565b73cf85e5ad29927ff63f0a17ae6fd5352c512f566281565b6000805b600954811015610ee257826001600160a01b031660098281548110610eb857fe5b6000918252602090912001546001600160a01b03161415610eda579050610547565b600101610e97565b50633b9ac9ff92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610f2f57805160ff1916838001178555610f5c565b82800160010185558215610f5c579182015b82811115610f5c578251825591602001919060010190610f41565b50610f68929150610f6c565b5090565b61052a91905b80821115610f685760008155600101610f7256fea265627a7a72315820a8c2421d8a083e9953a370501d9fe8c4aed4c3367948ea69d3c9930bcbcabd1164736f6c63430005110032";

    public static final String FUNC_ADMIN = "admin";

    public static final String FUNC_CANCEL = "cancel";

    public static final String FUNC_CHANGEFUNDINFO = "changeFundInfo";

    public static final String FUNC_CHANGEOWNER = "changeOwner";

    public static final String FUNC_CHANGESTATUS = "changeStatus";

    public static final String FUNC_CONTRIBUTE = "contribute";

    public static final String FUNC_GETBALANCEC = "getBalanceC";

    public static final String FUNC_GETCONTRIBUTORCOUNTS = "getContributorCounts";

    public static final String FUNC_GETFUNDINFO = "getFundInfo";

    public static final String FUNC_GETRECORDINFO = "getRecordInfo";

    public static final String FUNC_GETSTATUS = "getStatus";

    public static final String FUNC_RAISEFUND = "raiseFund";

    public static final String FUNC_REFUNDFEE = "refundFee";

    public static final String FUNC_REQUEST = "request";

    public static final String FUNC_SENDBACK = "sendBack";

    public static final String FUNC_VERIFY = "verify";

    public static final String FUNC_WITHDRAW = "withdraw";

    @Deprecated
    protected CrowdFunding(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    protected CrowdFunding(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
    }

    @Deprecated
    protected CrowdFunding(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    protected CrowdFunding(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public RemoteFunctionCall<String> admin() {
        final Function function = new Function(FUNC_ADMIN,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<TransactionReceipt> cancel() {
        final Function function = new Function(
                FUNC_CANCEL,
                Arrays.<Type>asList(),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> changeFundInfo(String info, BigInteger target) {
        final Function function = new Function(
                FUNC_CHANGEFUNDINFO,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Utf8String(info),
                        new org.web3j.abi.datatypes.generated.Uint256(target)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> changeOwner(String newOwner) {
        final Function function = new Function(
                FUNC_CHANGEOWNER,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, newOwner)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> changeStatus() {
        final Function function = new Function(
                FUNC_CHANGESTATUS,
                Arrays.<Type>asList(),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> contribute(BigInteger weiValue) {
        final Function function = new Function(
                FUNC_CONTRIBUTE,
                Arrays.<Type>asList(),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function, weiValue);
    }

    public RemoteFunctionCall<BigInteger> getBalanceC() {
        final Function function = new Function(FUNC_GETBALANCEC,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> getContributorCounts() {
        final Function function = new Function(FUNC_GETCONTRIBUTORCOUNTS,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<Tuple6<String, String, BigInteger, BigInteger, BigInteger, Boolean>> getFundInfo() {
        final Function function = new Function(FUNC_GETFUNDINFO,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Bool>() {}));
        return new RemoteFunctionCall<Tuple6<String, String, BigInteger, BigInteger, BigInteger, Boolean>>(function,
                new Callable<Tuple6<String, String, BigInteger, BigInteger, BigInteger, Boolean>>() {
                    @Override
                    public Tuple6<String, String, BigInteger, BigInteger, BigInteger, Boolean> call() throws Exception {
                        List<Type> results = executeCallMultipleValueReturn(function);
                        return new Tuple6<String, String, BigInteger, BigInteger, BigInteger, Boolean>(
                                (String) results.get(0).getValue(),
                                (String) results.get(1).getValue(),
                                (BigInteger) results.get(2).getValue(),
                                (BigInteger) results.get(3).getValue(),
                                (BigInteger) results.get(4).getValue(),
                                (Boolean) results.get(5).getValue());
                    }
                });
    }

    public RemoteFunctionCall<BigInteger> getRecordInfo(String contributor) {
        final Function function = new Function(FUNC_GETRECORDINFO,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, contributor)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> getStatus() {
        final Function function = new Function(FUNC_GETSTATUS,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint8>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> raiseFund(String info, BigInteger target) {
        final Function function = new Function(
                FUNC_RAISEFUND,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Utf8String(info),
                        new org.web3j.abi.datatypes.generated.Uint256(target)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<BigInteger> refundFee() {
        final Function function = new Function(FUNC_REFUNDFEE,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> request(BigInteger requestValue) {
        final Function function = new Function(
                FUNC_REQUEST,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(requestValue)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> sendBack() {
        final Function function = new Function(
                FUNC_SENDBACK,
                Arrays.<Type>asList(),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> verify(Boolean choice) {
        final Function function = new Function(
                FUNC_VERIFY,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Bool(choice)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> withdraw() {
        final Function function = new Function(
                FUNC_WITHDRAW,
                Arrays.<Type>asList(),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    @Deprecated
    public static CrowdFunding load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        return new CrowdFunding(contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    @Deprecated
    public static CrowdFunding load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return new CrowdFunding(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public static CrowdFunding load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        return new CrowdFunding(contractAddress, web3j, credentials, contractGasProvider);
    }

    public static CrowdFunding load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return new CrowdFunding(contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static RemoteCall<CrowdFunding> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        return deployRemoteCall(CrowdFunding.class, web3j, credentials, contractGasProvider, BINARY, "");
    }

    public static RemoteCall<CrowdFunding> deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return deployRemoteCall(CrowdFunding.class, web3j, transactionManager, contractGasProvider, BINARY, "");
    }

    @Deprecated
    public static RemoteCall<CrowdFunding> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        return deployRemoteCall(CrowdFunding.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
    }

    @Deprecated
    public static RemoteCall<CrowdFunding> deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return deployRemoteCall(CrowdFunding.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
    }
}
